<template>
  <div>
    <EditForm
      :infos="infos"
      operateType="edit"
      submitText="上传"
      :submitShow="false"
      @extraParam="extraParam"
      @click.native="clearKeybord"
    />
    <DrawMap v-if="mapId" :mapId="mapId" :mapTitle="mapTitle" />

  </div>
</template>

<script>
import EditForm from '@/components/EditForm/index'
import DrawMap from './map/drawMap.vue'
export default {
  name: 'kmlManage',
  components: {
    EditForm,
    DrawMap
  },
  data () {
    return {
      infos: [
        {
          label: '上传文件',
          key: 'fileList',
          type: 'upload',
          fileType: ['.kml'],
          multiple: false,
          value: []
        }
      ],
      mapId: '',
      mapTitle: ''
    }
  },
  methods: {
    extraParam (data) {
      this.mapId = data.data.id
      this.mapTitle = data.data.title
    },
    clearKeybord () {
      console.log('clearKeybord')
      document.onkeydown = null
      document.onkeyup = null
    }
  },
  destroyed () {
    this.clearKeybord()
  }
}
</script>

<style lang="" scoped></style>
